﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;

namespace SignalLab
{
  public class IsNullConverter : IValueConverter
  {
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
    
      bool isNull = value == null;
      if (targetType != null && targetType.Equals(typeof(Visibility)))
      {
        return isNull ? Visibility.Collapsed : Visibility.Visible;
      }
      return isNull;
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
    {
      throw new NotImplementedException();
    }
  }
}
